class RadusergroupsController < ApplicationController
  before_action :set_radusergroup, only: [:show, :edit, :update, :destroy]

  # GET /radusergroups
  # GET /radusergroups.json
  def index
    @radusergroups = Radusergroup.all
  end

  # GET /radusergroups/1
  # GET /radusergroups/1.json
  def show
  end

  # GET /radusergroups/new
  def new
    @radusergroup = Radusergroup.new
  end

  # GET /radusergroups/1/edit
  def edit
  end

  # POST /radusergroups
  # POST /radusergroups.json
  def create
    @radusergroup = Radusergroup.new(radusergroup_params)

    respond_to do |format|
      if @radusergroup.save
        format.html { redirect_to @radusergroup, notice: 'Radusergroup was successfully created.' }
        format.json { render action: 'show', status: :created, location: @radusergroup }
      else
        format.html { render action: 'new' }
        format.json { render json: @radusergroup.errors, status: :unprocessable_entity }
      end
    end
  end

  # PATCH/PUT /radusergroups/1
  # PATCH/PUT /radusergroups/1.json
  def update
    respond_to do |format|
      if @radusergroup.update(radusergroup_params)
        format.html { redirect_to @radusergroup, notice: 'Radusergroup was successfully updated.' }
        format.json { head :no_content }
      else
        format.html { render action: 'edit' }
        format.json { render json: @radusergroup.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /radusergroups/1
  # DELETE /radusergroups/1.json
  def destroy
    @radusergroup.destroy
    respond_to do |format|
      format.html { redirect_to radusergroups_url }
      format.json { head :no_content }
    end
  end

  private
    # Use callbacks to share common setup or constraints between actions.
    def set_radusergroup
      @radusergroup = Radusergroup.find(params[:id])
    end

    # Never trust parameters from the scary internet, only allow the white list through.
    def radusergroup_params
      params.require(:radusergroup).permit(:username, :groupname, :priority)
    end
end
